package client;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class SenderThread extends Thread {
	//Schleife
	public void run() {
		StartClient.chatOutput.append("Thread sendet");
		
		try {
			DatagramSocket toSocket = new DatagramSocket();
			DatagramPacket packet;

			//while(true) {
				
				//Anfrage senden
				InetAddress ia = InetAddress.getByName("127.0.0.1");
				int port2 = 2024;

				String s = "hannibal 4569516";
				byte data2[] = s.getBytes();

				packet = new DatagramPacket( data2, data2.length, ia, port2 );
				toSocket.send( packet );
			//}
	    }
	    catch ( Exception e )
	    {
	      System.out.println( e );
	    }
	 
	}
}
